package com.study.authority;

public class TestThis {
    public static void main(String[] args) {
        Cock c = new Cock();
        System.out.println(c.name);
    }
}
class Chicken{
    String name = "wuhu";
    int age;
    double weight;

    public void setName(String name) {
        //使用this来区别局部变量name和Chicken的成员变量name
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
}
class Cock extends Chicken{
    String name;
    int age;
    double weight;
}